//***********************************************************************************************
// For.java      Author:Duanzhixuan
//  Use the if statement to caculate the n!
//*************************************************************************************************

import java.util.Scanner;

public class For
{
public static void main(String[] args)
{
   Scanner generator = new Scanner(System.in);
   System.out.println("Please enter a positive int number or zero:");
int number = generator.nextInt();
int sum = 1;
  if (number == 0)
  System.out.println("阶乘为:1");//人为定义0的阶乘为1。
else
{
for(int num=number; num>0; num--)

  { sum*=num;}
System.out.println("阶乘为："+sum);
}
}
}
